_onCapturedEvent: function(actor, event) {
if (event.type() == Clutter.EventType.BUTTON_PRESS) {
let source = event.get_source();
- if (source != this._text && this._text.text == '' &&
+ if (source != this._text &&
+ this._text.text == '' &&
+ !this._text.has_preedit () &&
!Main.layoutManager.keyboardBox.contains(source)) {
// the user clicked outside after activating the entry, but
// with no search term entered and no keyboard button pressed
GdkWindow *window;
guint need_im_reset : 1;
+ guint has_preedit : 1;
};
G_DEFINE_TYPE (StIMText, st_im_text, CLUTTER_TYPE_TEXT)
preedit_attrs,
cursor_pos);
+ imtext->priv->has_preedit = preedit_str && *preedit_str;
+
g_free (preedit_str);
pango_attr_list_unref (preedit_attrs);
}
return hints;
}
+
+/**
+ * st_im_text_has_preedit:
+ * @imtext: a #StIMText
+ *
+ * Returns: wether @imtext currently has preedit text
+ */
+gboolean
+st_im_text_has_preedit (StIMText *imtext)
+{
+ g_return_val_if_fail (ST_IS_IM_TEXT (imtext), FALSE);
+
+ return imtext->priv->has_preedit;
+}
void st_im_text_set_input_hints (StIMText *imtext,
GtkInputHints hints);
GtkInputHints st_im_text_get_input_hints (StIMText *imtext);
+gboolean st_im_text_has_preedit (StIMText *imtext);
void st_im_text_set_event_window (GdkWindow *window);